package com.yc.project3_bestMatching;

import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;

public class TestMain_2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        String path= System.getProperty( "user.home") ;
        path = path+ File.separator+"projects_sources"+File.separator+"project3_bestMatching"+File.separator+"UK Advanced Cryptics Dictionary.txt";
        System.out.println(path);
        WordsLoader.load(path);
        List<String> list= WordsLoader.load( path );
        System.out.println("词汇表总量:"+ list.size() );
        Date start=new Date() ;
        String word="sdt" ;
        BestMatchingData  result= BestMatchingConcurrentCalculation. getBestMatchingWords( word, list);
        Date end =new Date();
        int minDistance = result.getDistance();
        List<String> wordList = result.getWords();
        System.out.println("最短编辑距离为:"+ minDistance);
        for( String s:wordList){
            System.out.print( s+"\t" );
        }
        System.out.println( "最执行时长为:"+(end.getTime()-start.getTime()));

    }
}
